<?php

$images_url = base_url('images');
$main_url = base_url('main');

$mapdir = "
	<a href='$main_url'>Home</a>
	&gt; 
";

$namausaha = "";

$menu = $this->uri->segment(4, 'all');
$awal = $this->input->get('awal');
$jumhal = 1;
$dataloker = "";

if($menu == "company")
{
	$idc = $this->uri->segment(3, 0);
	$loker = $this->mainmodel->get_lowongan_perusahaan($idc, $awal);
	$namausaha = $this->mainmodel->get_single_data('nama','dn_company','idperusahaan', $idc);
	$mapdir .= "<a href='$main_url/loker' style='color:#b70bac'>Info Lowongan</a> &gt; <b>$namausaha</b>";
	$namausaha = "<h5>Info Lowongan dari ".$namausaha."</h5>";
	$config['base_url'] = base_url('main/loker/'.$idc.'/company.html?show=data');
	$jumhal = $this->mainmodel->get_hitung_lowongan_perusahaan($idc);
}else{
	$mapdir .= "<b>Info Lowongan</b>";
	$loker = $this->mainmodel->get_lowongan($awal);
	$config['base_url'] = base_url('main/loker/lowongan/kerja.html?show=data');
	$jumhal = $this->mainmodel->get_hitung_lowongan();
}

try{
	$hit = $awal+1;
}catch(Exception $e){
	$hit = 1;
}


if($loker !== FALSE)
{
	
	foreach($loker AS $ldata)
	{
		$title = url_title(strtolower($ldata->posisi));
		$dataloker .= "
			<tr>
				<td class='left'>$hit. <a target='_blank' href='$company_url/detail/$ldata->idjob/loker/$title.html'>$ldata->posisi</a></td>
				<td class='right'><a target='_blank' href='$company_url/detail/$ldata->idjob/loker/$title.html'>Detail</a> </td>
			</tr>";
		$hit++;
	}
	
}else{
	$dataloker .= "
		<tr>
			<td class='left'>&nbsp;</td>
			<td class='right'>Data Tidak Ditemukan</td>
		</tr>";
}


$config['total_rows'] = $jumhal;
$config['per_page'] = 10; 
$config['page_query_string'] = TRUE; 
$config['query_string_segment'] = 'awal';

$this->pagination->initialize($config); 		
$halaman = $this->pagination->create_links();


$isipage = "
	<div id='content2'>
			<h3>Info Lowongan Kerja</h3>
				
				
				<div class='isicontent2'>
					<div id='loker'>
					$namausaha
					<table>
						<tbody>
						
						$dataloker
								
						<tr>
							<td class='left'>&nbsp;</td>
							<td class='right'>$halaman</td>
						</tr>
						</tbody>
					</table>
					</div>
				  
				</div>
				
			</div>
";

$data['map_dir'] = $mapdir;
$data['isi_page'] = $isipage;
$data['site_title'] = 'Daftar Lowongan Kerja - Dadan Network';
$data['site_description'] = 'Dadan Network adalah situs berbagi informasi tentang jaringan profesional antar enterpreneur indonesia';
$data['site_keywords'] = 'dadan, network, profesional, enterpreneur, produk, usaha';
$data['base_url'] = base_url();
$data['tahun_sekarang'] = date("Y");
$data['other_head'] = '';

$this->parser->parse('template/home', $data);

/* End of file loker.php */
/* Location: ./application/views/main/loker.php */
